package com.wrk._1_语法._04_循环._01_单循环;

public class _002_求1到100所有数相加和 {
    public static void main(String[] args) {
        //定义变量
        int sum =0;
        int number=1;
        //循环相加100次
        do {
            sum =number+sum;
            number++;
        }
        while (number<=100);
        System.out.println("1+2+3…100的和为:"+sum);
    }
}
